<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Lack of Cohesion in Methods - Total Correlation</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <link href="../../style.css" type="text/css" rel="STYLESHEET"/>
    </head>
    <body>
        <h1>Total Correlation
        	<span id="logo"><a href="http://eclipse-metrics.sourceforge.net"> <img src="../../images/logo.gif" border="0" alt="Metrics Logo"/></a></span>
        </h1>
        <p>This definition of Lack of Cohesion use Watanabe's (1960) generalisation of <a href="http://en.wikipedia.org/wiki/Mutual_information"
                title="Wikipedia article on Mutual Information">mutual information</a> known as <a href="http://en.wikipedia.org/wiki/Total_correlation"
                title="Wikipedia article on Total Correlation">Total Correlation</a>, which determines if a group of variables exhibit
                <i>redundancy</i> or <i>structure</i>.</p>
        <p>Its application to the measurement of cohesion is simple. Each method in a class makes use of a subset of the fields of the class.
        	We want to know whether these subsets exhibit some structure in the pattern of field usage. If such a structure exists then it can be
        	extracted into one or more other classes in order to remove or reduce the structure. We may therefore consider the <i>use</i> of
        	each field by the methods as a 'random' binary variable with a certain probability of occurrence. The rest follows naturally from the
            definition of Total Correlation.</p>
        <p>Although removal of structure would normally be considered a bad thing in software, the ideal cohesive scenario of 'all fields used
        	by all methods' exhibits <i>no</i> structure in field usage.</p>
        <hr/>
        <p><b>Note 1:</b> I have only included methods if they access at least one field.</p>
        <p><b>Note 2:</b> I have only included fields if they are accessed by at least one method in the class.</p>
        <hr/>
        <div class="attribution">
    		This plugin is provided by <a href="http://www.stateofflow.com" title="State Of Flow homepage">State Of Flow</a>
    	</div>
    </body>
</html>